﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/MasterPage.master" AutoEventWireup="true"
    CodeFile="BookingNoteList.aspx.cs" Inherits="BookingNote_BookingNoteList" Title="托运单列表"
    Culture="auto" meta:resourcekey="PageResource3" UICulture="auto" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <div class="title">
                <asp:Label ID="lblTitle" runat="server" Text="托运单信息列表" meta:resourcekey="lblTitleResource1"></asp:Label></div>
            <table class="add_table" cellspacing="1" cellpadding="3">
            
            <tr style="height: 50px">
                    <td align="right">
                        <asp:Label ID="lblShipperName" runat="server" Text="托运人：" meta:resourcekey="lblShipperNameResource1"></asp:Label>
                    </td>
                    <td>
                        <table width="100%">
                            <tr>
                                <td rowspan="6" align="center">
                                    <asp:ListBox ID="lstShipper" runat="server" Width="100px" 
                                        SelectionMode="Multiple" meta:resourcekey="lstShipperResource1" />
                                    <cc1:ListSearchExtender ID="ListSearchExtender2" runat="server" TargetControlID="lstShipper"
                                        PromptCssClass="ListSearchExtenderPrompt" Enabled="True">
                                    </cc1:ListSearchExtender>
                                </td>
                                <td style="height: 2px">
                                </td>
                                <td rowspan="6" align="left">
                                    <asp:ListBox ID="lstSelShipper" runat="server" Width="100px" 
                                        SelectionMode="Multiple" meta:resourcekey="lstSelShipperResource1">
                                    </asp:ListBox>
                                    <cc1:ListSearchExtender ID="ListSearchExtender4" runat="server" TargetControlID="lstSelShipper"
                                        PromptCssClass="ListSearchExtenderPrompt" Enabled="True">
                                    </cc1:ListSearchExtender>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Button ID="btnAdd" runat="server" CssClass="btn" Text="添加" 
                                        onclick="btnAdd_Click" meta:resourcekey="btnAddResource1" />
                                    <br />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Button ID="btnDelete" runat="server" CssClass="btn" Text="刪除" 
                                        onclick="btnDelete_Click" meta:resourcekey="btnDeleteResource1" />
                                    <br />
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td align="right">
                        <asp:Label ID="lblVendorName" runat="server" Text="工厂：" meta:resourcekey="lblVendorNameResource1"></asp:Label>
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlVendor" runat="server" meta:resourcekey="ddlVendorResource1">
                        </asp:DropDownList>
                        <cc1:ListSearchExtender ID="ListSearchExtender1" runat="server" TargetControlID="ddlVendor"
                            PromptCssClass="ListSearchExtenderPrompt" Enabled="True">
                        </cc1:ListSearchExtender>
                    </td>
                </tr>            
                <tr style="height: 50px">
                    <td align="right">
                        <asp:DropDownList ID="ddlColumnName" runat="server" meta:resourcekey="ddlColumnNameResource1">
                           <%-- <asp:ListItem Text="托运人" Value="ShipperID" meta:resourcekey="ListItemResourceShipper"></asp:ListItem>--%>
                             <asp:ListItem Text="联络人" Value="ShipperLMID" meta:resourcekey="ListItemResourceShipperLMID"></asp:ListItem>
                            <asp:ListItem Text="发票号" Value="InvoiceNO" meta:resourcekey="ListItemResource3"></asp:ListItem>
                            <asp:ListItem Text="OC#" Value="ConfirmNO" meta:resourecekey="ListItemResourceOC"></asp:ListItem>
                             <asp:ListItem Text="Appointament" Value="Appointament" meta:resourecekey="ListItemResourceAppointament"></asp:ListItem>
                            <asp:ListItem Text="装货单" Value="PcNO" meta:resourcekey="ListItemResource4"></asp:ListItem>
                            <asp:ListItem Text="客户客人" Value="CustomerID" meta:resourcekey="ListItemResource5"></asp:ListItem>
                            <asp:ListItem Text="市场" Value="MarketID" meta:resourcekey="ListItemResource12"></asp:ListItem>
                            <asp:ListItem Text="目的地" Value="DestinationID" meta:resourcekey="ListItemResource13"></asp:ListItem>
                            <asp:ListItem Text="船公司/货代" Value="CarrierForwar" meta:resourcekey="ListItemResource8"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td>
                        <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
                    </td>
                    <td align="right">
                        <asp:DropDownList ID="ddlColumnName2" runat="server" meta:resourcekey="ddlColumnName2Resource1">
                            <asp:ListItem Text="开仓日" Value="WinStart" meta:resourcekey="ListItem2Resource1"></asp:ListItem>
                            <asp:ListItem Text="截数日" Value="WinClose" meta:resourcekey="ListItem2Resource2"></asp:ListItem>
                            <asp:ListItem Text="最后截数日" Value="WinLastClose" meta:resourcekey="ListItem2Resource3"></asp:ListItem>
                              <asp:ListItem Text="收货日" Value="JobDate" meta:resourcekey="ListItem2ResourceJobDate"></asp:ListItem>
                               <asp:ListItem Text="交货日" Value="DeliveryDate" meta:resourcekey="ListItem2ResourceDeliveryDate"></asp:ListItem>
                            <asp:ListItem Text="开单日期" Value="BillDate" meta:resourcekey="ListItem2Resource4"></asp:ListItem>
                            <asp:ListItem Text="审核时间" Value="CheckedDate" meta:resourcekey="ListItem2Resource5"></asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td>
                      <%--  <asp:Label ID="lblBetween" runat="server" Text="Between：" meta:resourcekey="lblBetweenResource1"></asp:Label>--%>
                        <asp:TextBox ID="txtBetween" runat="server" onkeydown="return pdDate(this, event);" meta:resourcekey="ttxtName2Resource1"  Width="100px" ></asp:TextBox>
                        &nbsp;- <%--<asp:Label ID="lblTo" runat="server" Text="To：" meta:resourcekey="lblToResource1"></asp:Label>--%>
                         <asp:TextBox
                            ID="txtTo" runat="server" onkeydown="return pdDate(this, event);"  Width="100px" ></asp:TextBox>
                      
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtBetween"
                            ValidationGroup="bookingnote" ErrorMessage="日期格式不正确" ValidationExpression="((1[89]\d{2})|([2-8]\d{3}))[-](([1][012])|(0{1}[1-9]))[-]((3[01])|([12]\d)|(0{1}[1-9]))"
                            meta:resourcekey="RegularExpressionValidator1Resource1"></asp:RegularExpressionValidator>                      
                        &nbsp;
                     
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="txtTo"
                            ValidationGroup="bookingnote" ErrorMessage="日期格式不正确" ValidationExpression="((1[89]\d{2})|([2-8]\d{3}))[-](([1][012])|(0{1}[1-9]))[-]((3[01])|([12]\d)|(0{1}[1-9]))"
                            meta:resourcekey="RegularExpressionValidator2Resource1"></asp:RegularExpressionValidator>
                    </td>                   
                </tr>
                <tr>
                 <td align="right">
                        <asp:Label ID="lblStatus" runat="server" Text="状态：" meta:resourcekey="lblStatusResource1"></asp:Label>
                    </td>
                    <td>
                        <asp:RadioButton ID="radAll" runat="server" Text="全部" Checked="True" GroupName="status"
                            meta:resourcekey="radAllResource1" />
                        <asp:RadioButton ID="radInput" runat="server" Text="录入" GroupName="status" meta:resourcekey="radInputResource1" /><asp:RadioButton
                            ID="radCheck" runat="server" Text="审核" GroupName="status" meta:resourcekey="radCheckResource1" /><asp:RadioButton
                                ID="radCancel" runat="server" Text="取消" GroupName="status" meta:resourcekey="radCancelResource1" />
                    </td>
                    <td align="center" colspan="2">
                        <asp:Button ID="btnSearch" runat="server" CssClass="btn" Text="搜索" OnClick="btnSearch_Click"
                            ValidationGroup="bookingnote" meta:resourcekey="btnSearchResource1" />
                    </td>
                </tr>
            </table>
            <div id="divEntrust" runat="server">
                <div class="list_title">
                    <div class="autoleft">
                        <asp:Label ID="lblTotal" runat="server" meta:resourcekey="lblTotalResource1"></asp:Label>
                        <asp:Label ID="lblRecordFound" runat="server" Text="条记录" meta:resourcekey="lblRecordFoundResource1"></asp:Label>&nbsp;<a
                            href="BookingNoteEdit.aspx"><asp:Label ID="lblBookingNoteEdit" runat="server" Text="添加托运单"
                                meta:resourcekey="lblBookingNoteEditResource1"></asp:Label></a>&nbsp;
                                <asp:Button ID="lbtnUpdates" runat="server" Text="修改" CssClass="btn" 
                            onclick="lbtnUpdates_Click" meta:resourcekey="lbtnUpdatesResource1" ></asp:Button>&nbsp;
                            <asp:Button ID="lbtnDelete" runat="server" Text="删除" CssClass="btn" 
                            onclick="lbtnDelete_Click" meta:resourcekey="lbtnDeleteResource1" />
                                </div>
                    <div class="autoright">
                        <asp:Label ID="lblPerPage" runat="server" Text="每页显示：" meta:resourcekey="lblPerPageResource1"></asp:Label>
                        <asp:DropDownList ID="ddlPages" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlPages_SelectedIndexChanged"
                            meta:resourcekey="ddlPagesResource1">
                            <asp:ListItem Selected="True" Text="10" Value="10" meta:resourcekey="ListItemResource1"></asp:ListItem>
                            <asp:ListItem Text="20" Value="20" meta:resourcekey="ListItemResource2"></asp:ListItem>
                        </asp:DropDownList>
                    </div>
                </div>
                <asp:GridView ID="gvBookNoteList" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                    Width="100%" AllowSorting="True" OnPageIndexChanging="gvBookNoteList_PageIndexChanging"
                    OnRowCommand="gvBookNoteList_RowCommand" OnRowDataBound="gvBookNoteList_RowDataBound"
                    OnSorting="gvBookNoteList_Sorting" CssClass="tblGridView" meta:resourcekey="gvBookNoteListResource1">
                    <PagerTemplate>
                        <table style="width: 100%">
                            <tr>
                                <td>
                                    <asp:Label ID="lblPerPage" runat="server" Text="页次" meta:resourcekey="lblPerPageResource2"></asp:Label>:&nbsp;<asp:Label
                                        ID="Label1" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageIndex+1 %>'
                                        meta:resourcekey="Label1Resource1"></asp:Label>/<asp:Label ID="Label2" runat="server"
                                            Text='<%# ((GridView)Container.Parent.Parent).PageCount %>' meta:resourcekey="Label2Resource1"></asp:Label><asp:Label
                                                ID="lblPage" runat="server" Text="页" meta:resourcekey="lblPageResource1"></asp:Label>&nbsp;
                                    <asp:Label ID="lblTotalPages" runat="server" Text="总计" meta:resourcekey="lblTotalPagesResource1"></asp:Label>:&nbsp;<asp:Label
                                        ID="Label3" runat="server" Text="<%# ((System.Data.DataView)gvBookNoteList.DataSource).Count %>"
                                        meta:resourcekey="Label3Resource1"></asp:Label>
                                </td>
                                <td align="right">
                                    <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Page" CommandArgument="First"
                                        Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=0 %>" Text="首页" meta:resourcekey="LinkButton1Resource1"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument="Prev" CommandName="Page"
                                        Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=0 %>" Text="前页" meta:resourcekey="LinkButton2Resource1"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton3" runat="server" CommandName="Page" CommandArgument="Next"
                                        Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=((GridView)Container.Parent.Parent).PageCount-1 %>"
                                        Text="后页" meta:resourcekey="LinkButton3Resource1"></asp:LinkButton>
                                    <asp:LinkButton ID="LinkButton4" runat="server" CommandArgument="Last" CommandName="Page"
                                        Enabled="<%# ((GridView)Container.Parent.Parent).PageIndex!=((GridView)Container.Parent.Parent).PageCount-1 %>"
                                        Text="尾页" meta:resourcekey="LinkButton4Resource1"></asp:LinkButton>&nbsp;
                                    <asp:Label ID="lblTurnOn" runat="server" Text="转第" meta:resourcekey="lblTurnOnResource1"></asp:Label>
                                    <asp:TextBox ID="txtPages" runat="server" Width="35px" meta:resourcekey="txtPagesResource1"></asp:TextBox>
                                    <asp:Label ID="lblPages2" runat="server" Text="页" meta:resourcekey="lblPages2Resource1"></asp:Label>
                                    <asp:LinkButton ID="lbtnGo" runat="server" Text="提交" OnClick="lbtnGo_Click" meta:resourcekey="lbtnGoResource1"></asp:LinkButton>
                                </td>
                            </tr>
                        </table>
                    </PagerTemplate>
                    <PagerSettings Mode="NumericFirstLast" />
                    <Columns>
                    
                     <asp:TemplateField HeaderText="选择" meta:resourcekey="TemplateFieldResourceSelect">
                                <ItemTemplate>
                                    <input type="radio" name="chkSelected" value='<%# Eval("PKID") %>' />
                                </ItemTemplate>
                                  <ItemStyle Width="5%" />
                            </asp:TemplateField>
                    
                        <asp:TemplateField HeaderText="序号" meta:resourcekey="TemplateFieldResource1">
                            <ItemTemplate>
                                <asp:Label ID="lblNo" runat="server" Text='<%# (Container as GridViewRow).RowIndex + 1 %>'
                                    meta:resourcekey="lblNoResource2"></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="5%" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="发票号" SortExpression="InvoiceNO" meta:resourcekey="TemplateFieldResource2">
                            <ItemTemplate>
                                <asp:Label ID="lblInvoiceNO" runat="server" Text='<%# Eval("InvoiceNO") %>' meta:resourcekey="lblInvoiceNOResource3"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        
                         <asp:TemplateField HeaderText="确认单号" SortExpression="ConfirmNO" meta:resourcekey="TemplateFieldResourceConfirmNO">
                            <ItemTemplate>
                                <asp:Label ID="lblConfirmNO" runat="server" Text='<%# Eval("ConfirmNO") %>' meta:resourcekey="lblConfirmNOResource3"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="托运人" SortExpression="ShipperENGShortName" meta:resourcekey="TemplateFieldResource3">
                            <ItemTemplate>
                                <asp:Label ID="lblShipperCNShortName" runat="server" Text='<%# Eval("ShipperCNShortName") %>'
                                    meta:resourcekey="lblShipperCNShortNameResource1"></asp:Label>
                                <asp:Label ID="lblShipperHKShortName" runat="server" Text='<%# Eval("ShipperHKShortName") %>'
                                    meta:resourcekey="lblShipperHKShortNameResource1"></asp:Label>
                                <asp:Label ID="lblShipperENGShortName" runat="server" Text='<%# Eval("ShipperENGShortName") %>'
                                    meta:resourcekey="lblShipperENGShortNameResource1"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                       <%-- <asp:TemplateField HeaderText="详细数目" meta:resourcekey="TemplateFieldResource4">
                            <ItemTemplate>
                                <asp:Label ID="lblTotalNum" runat="server" Text='<%# GetTotalNum(Eval("PKID")) %>'
                                    meta:resourcekey="lblTotalNumResource2"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>--%>
                        <asp:TemplateField HeaderText="完成度" meta:resourcekey="TemplateFieldResource5">
                            <ItemTemplate>
                                <asp:Label ID="lblComplete" runat="server" Text='<%# GetComplete(Eval("PKID")) %>'
                                    meta:resourcekey="lblCompleteResource2"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <%--<asp:TemplateField HeaderText="状态" meta:resourcekey="TemplateFieldResource6">
                            <ItemTemplate>
                                <asp:Label ID="lblStatus" runat="server" Text='<%# HK2009.Common.StringUtil.GetBnStatus(Eval("Status")) %>'
                                    meta:resourcekey="lblStatusResource3"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>--%>
                        
                        <asp:TemplateField HeaderText="输单日期">
                        <ItemTemplate>
                        <asp:Label ID="lblBillDate" runat="server" Text='<%# Eval("BillDate","{0:yyyy-MM-dd}") %>'></asp:Label>
                        </ItemTemplate>
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="详情" meta:resourcekey="TemplateFieldResource7">
                            <ItemTemplate>
                                <a href='BookingNoteLook.aspx?BookingNoteID=<%# Eval("PKID") %>'>
                                    <asp:Label ID="lblLook" runat="server" Text="查看" meta:resourcekey="lblLookResource2"></asp:Label></a>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <%--<asp:TemplateField HeaderText="操作" meta:resourcekey="TemplateFieldResource8">
                            <ItemTemplate>
                                <a href='BookingNoteUpdate.aspx?BookingNoteID=<%# Eval("PKID") %>'>
                                    <asp:Label ID="lblEdit" runat="server" Text="修改" meta:resourcekey="lblEditResource2"></asp:Label></a>
                                <asp:LinkButton ID="lbtnDel" runat="server" Text="删除" CommandArgument='<%# Eval("PKID") %>'
                                    OnClientClick='<%#"javascript:return confirm(\""+   Resources.Messages.DelRecord  +"\")"%>'
                                    CommandName="Del" meta:resourcekey="lbtnDelResource2"></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle Width="20%" />
                        </asp:TemplateField>--%>
                    </Columns>
                    <HeaderStyle HorizontalAlign="Center" />
                    <RowStyle HorizontalAlign="Center" />
                </asp:GridView>
            </div>
            </div>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnSearch" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="btnAdd" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
